package com.pb.camera.more;

import com.pb.camera.utils.Logger;
import com.pb.camera.utils.TaskHelper;
import com.pb.camera.utils.TaskHelper.Task;
import com.pb.camera.work.IOTCInit;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

/*
 * Created by LiuFei just For Test!!!!!!!
 * delete it ! 
 */
public class SplashActivity extends Activity {
    protected static final String TAG = "SplashActivity";
    

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        TaskHelper.exec(new Task() {
            boolean initReslut;

            @Override
            public void execute() throws Exception {
                IOTCInit initer = IOTCInit.getDefault();
                //TODO:This is a test uid number
                initer.setUID("YSS6XCZETL3FTPRH111A");
                initReslut = initer.runInit();
            }

            @Override
            public void callback(Exception e) {
                if (initReslut) {
                    Logger.d(TAG, "init Success");
                    Intent intent = new Intent(SplashActivity.this, MoreActivity.class);
                    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                    startActivity(intent);
                }
                finish();
            }
        });
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }
}
